package com.demo.ribbon.server.aop;

import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class RibbonMonitor {
//    @Autowired
//    CounterService counterService;      //统计每个接口调用次数
//    @Autowired
//    GaugeService gaugeService;          //统计每个接口调用时长
//
//    @Before("execution(* com.demo.ribbon.server.controller.*.*(..))")
//    public void countServiceInvoke(JoinPoint joinPoint) {
//        counterService.increment(joinPoint.getSignature() + "");
//    }
//
//    @Around("execution(* com.demo.ribbon.server.controller.*.*(..))")
//    public void latencyService(ProceedingJoinPoint pjp) throws Throwable {
//        long start = System.currentTimeMillis();
//        pjp.proceed();
//        long end = System.currentTimeMillis();
//        gaugeService.submit(pjp.getSignature().toString(), end - start);
//    }

}
